import request from "@/utils/request";

import type { ILoginData, IUserInfo, ILoginParams } from "./model/index";

enum API {
  LOGIN = "/admin/acl/index/login", // 登录
  USERINFO = "/admin/acl/index/info", // 用户数据
  LOGOUT = "/admin/acl/index/logout", // 退出登录
}

// 登录
export const reqLogin = (data: ILoginParams) =>
  request.post<any, ILoginData>(API.LOGIN, data);

// 获取用户信息
export const reqUserInfo = () => request.get<any, IUserInfo>(API.USERINFO);

// 退出登录
export const reqLogout = () => request.post<any, any>(API.LOGOUT);
